// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLName*;
// import com.alibaba.druid.sql.ast.SQLObject*;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor*;

#include "SQLDropEventStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"
#include "../SQLObject.h"
#include "../../../DbType.h"
#include "../../../utils/instanceof.h"

SQLDropEventStatement::SQLDropEventStatement()
{
}

SQLDropEventStatement::SQLDropEventStatement(DbType_ptr  dbType)
    : SQLStatementImpl(dbType)
{
}

void SQLDropEventStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLDropEventStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLDropEventStatement));
}

SQLName_ptr SQLDropEventStatement::getName()
{
  return name;
}

void SQLDropEventStatement::setName(SQLName_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLDropEventStatement));
  }
  this->name = x;
}

BOOL_ptr SQLDropEventStatement::isIfExists()
{
  return ifExists;
}

void SQLDropEventStatement::setIfExists(BOOL_ptr ifExists)
{
  this->ifExists = ifExists;
}

SQLObject_list_ptr  SQLDropEventStatement::getChildren()
{
  SQLObject_list_ptr  children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != NULL)
  {
    children->push_back(std::dynamic_pointer_cast<SQLObject>(name));
  }
  return children;
}
